home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _ras.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  5KB  |  140 lines

  1. VERSION 5.00
  2. Begin VB.Form frmRas 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Remote Access Service"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4845
  13.    ScaleWidth      =   7485
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   7485
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   7110
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   6210
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   6570
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   4755
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.TextBox txt_Result 
  65.       BackColor       =   &H00C0C0C0&
  66.       BorderStyle     =   0  'None
  67.       Height          =   4110
  68.       Left            =   105
  69.       Locked          =   -1  'True
  70.       MultiLine       =   -1  'True
  71.       ScrollBars      =   2  'Vertical
  72.       TabIndex        =   0
  73.       Top             =   630
  74.       Width           =   7260
  75.    End
  76. Attribute VB_Name = "frmRas"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Base 1
  83. Private Const Iteration = 25
  84. Dim IsLoaded         As Integer
  85. Dim TimerStartOk     As Integer
  86. Dim TimerCloseOk     As Integer
  87. Dim TimerHandle      As Integer
  88. Dim TimerValue       As Long
  89. Private Sub cmb_Function_Click()
  90.    If (IsLoaded = False) Then Exit Sub
  91.    Call cDisableFI(mdiT2W.Picture1)
  92.    txt_Result = ""
  93.    DoEvents
  94.    Select Case cmb_Function.ListIndex
  95.       Case 0
  96.          Call TestRasGetCountryInfo
  97.    End Select
  98.    DoEvents
  99.    Call cEnableFI(mdiT2W.Picture1)
  100. End Sub
  101. Private Sub cmdNP_Click(Index As Integer)
  102.    Call sub_NextPrev(cmb_Function, Index)
  103. End Sub
  104. Private Sub Form_Activate()
  105.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  106. End Sub
  107. Private Sub Form_Load()
  108.    IsLoaded = False
  109.    Show
  110.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ras.t2w")
  111.    IsLoaded = True
  112. End Sub
  113. Private Sub Command1_Click()
  114.    Call cmb_Function_Click
  115. End Sub
  116. Private Sub TestRasGetCountryInfo()
  117.    Dim intResult        As Integer
  118.    Dim strDisplay       As String
  119.    Dim i                As Integer
  120.    strDisplay = ""
  121.    Dim CI               As tagCOUNTRYINFO
  122.    intResult = cRasGetCountryInfo(0, CI, True)
  123.    strDisplay = strDisplay & "Code" & vbTab & "ID" & vbTab & "Name" & vbCrLf & vbCrLf
  124.       
  125.    Do While (intResult = RAS_SUCCESS)
  126.       strDisplay = strDisplay & CI.iCountryCode & vbTab & CI.iCountryID & vbTab & CI.sCountryName & vbCrLf
  127.       
  128.       intResult = cRasGetCountryInfo(0, CI, False)
  129.    Loop
  130.    txt_Result = strDisplay
  131.    'time the function
  132.    TimerHandle = cTimerOpen()
  133.    TimerStartOk = cTimerStart(TimerHandle)
  134.    For i = 1 To Iteration
  135.       intResult = cRasGetCountryInfo(0, CI, True)
  136.    Next i
  137.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  138.    TimerCloseOk = cTimerClose(TimerHandle)
  139. End Sub
  140.